1. Field of the Invention
The present invention relates to an image processing device capable of performing encoding processing according to a compression method for compressing multilevel image data and encoding processing according to a compression method for compressing binary image data, and to an image reading device equipped with the image processing device.
2. Description of the Related Art
There is a color digital copying machine furnished with a technique of automatically determining whether an image read by the image reading portion is a monochrome (black and white) image or a color image by the ACS (Auto Color Selection) processing (for example, JP-A-11-155045). Further, there is a copying machine furnished with a capability of enabling the user to select whether the encoding processing by the MMR (Modified Modified Read) (ITU-T T.6) compression method for compressing binary image data or the encoding processing by the JPEG (Joint Photographic Experts Group) compression method for compressing multilevel image data is to be performed when the image is determined as being a monochrome image from the result of the ACS processing in a case where the copying machine transmits the image data to an external device (for example, a personal computer, hereinafter abbreviated as PC), and this copying machine is now available in the market.
Meanwhile, when red and black are the colors of a two-color document, the document is not determined as being a two-color document by the ACS processing. This poses a problem that although the document is a two-color document, processing in the ACS mode is performed in the same manner as in the full-color mode. In order to solve this problem, JP-A-2007-97169 discloses a technique to determine whether a document is a full color document, a black document, or a two-color document on the basis of color information of the image data using histogram information and color difference level information, so that image processing is performed according to the determination result.
Incidentally, the copying machine furnished with the capability of enabling the user to select the type of encoding processing in a case where the image is a monochrome image has a problem as follows.
That is, the encoding processing according to the MMR compression method is normally selected to make a volume (size) of a file of the image data smaller than in a case where the image data is compressed by the JPEG compression method. However, in a case where the encoding processing by the MMR compression method is selected for image data in which image data forming a halftone image is present in large parts, the file size after the compression becomes larger than in a case where the image data is compressed by the encoding processing by the JPEG compression method in some cases, and under certain circumstances, the file size becomes larger than the size of a file when the original image data is filed intact.
For example, in a case where a sheet of the document is coarse paper, the sheet is colored as a whole. Moreover, the color distribution across the sheet per se is not uniform and there is a minute change. In a case where a reading operation is performed for a document of such a sheet, the image data obtained from the background other than the image is not constant. In a case where a sheet of the document is so-called normal paper, the image data obtained from the background other than the image is constant. The image data can be therefore compressed at a high compression ratio. On the contrary, in a case where a sheet of the document is coarse paper as described above, image data is compressed only at an extremely low compression ratio because the obtained image data is not constant. Further, because the image data is not constant, there arises a need to generate data as the data that should be generated separately. The file size therefore becomes larger than the size of a file when the original image data is filed intact.
A compression method called the high-compression PDF is adoptable instead of the MMR compression method. In this case, however, because images other than characters and ruled lines are compressed by the JPEG compression method by the high-compression PDF, there is a possibility that a file size is increased. Also, in a case where the high-compression PDF is adopted as the compression method, additional hardware or software may be required. In addition, in a case where software is added, the processing time may possibly be extended because of the added software.
Further, it may be possible to reduce a data volume to be transmitted to a network by configuring in such a manner that the encoding processing is performed by the JPEG compression method first and thence the image data after the encoding processing is transmitted to the PC, so that the file format for the image data after the encoding processing is converted in the PC (converted to binary image data). In this case, however, data having a relatively high frequency component, such as character information, may be lost when the file format is converted in the PC, which possibly deteriorates the image quality. It is therefore preferable that an image suitable to the MMR compression method is compressed by the MMR compression method and saved to a data file.